import service from '@/utils/request'
import { getLoginType  } from "@/utils/auth";

const LoginApi = {
  loginByUsername: function (data) {
    return service.post('admin/login', data);
  },
  /* sysUserLoginOut: function(token) {
    const data = {token: token}
    return service.post('sysUserLoginOut', data)
  }, */
  sysUserLoginOut: function () {
    return service.delete('admin/login');
  },
  getUserInfoByToken: function (token) {
    const data = {token: token}
    return service.post('admin/getInfoByToken', data);
  },
  // :fixme User Exit Logout 🎃
  logout:function(){
    return service.delete(`${window.location.origin}${process.env.AUTH_URL}/token/logout`);
  },
}

export default LoginApi
